/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
$(function () {
    $(".info_confirm").click(function () {
        var loginName = $("#loginName").val();
        var trueName = $("#trueName").val();
        var sex = $("input[name='sex']:checked").val();
        var birthday = $("#sel_year").val() + "-" + $("#sel_month").val() + "-" + $("#sel_day").val();
        var userId = $("#hiddenUserId").val();
        $.ajax({
            type: "post",
            url: "/updateinfo.do",
            timeout: 1000,
            data: {loginName: loginName, trueName: trueName, sex: sex, birthday: birthday, userId: userId},
            dataType: "text",
            cache: false,
            success: function (data) {
                if (data === "success") {
                    alert("更改成功");
                    location.href = "/info.do";
                } else {
                    alert("更改失败");
                    location.reload();
                }
            }
        });
    });

});


